package jcpcotizaciones;

import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import jcpcotizaciones.vista.*;

/**
 * The application's main frame.
 */
public class JCPCOTIZACIONESView extends FrameView {

    public JCPCOTIZACIONESView(SingleFrameApplication app) {
        super(app);
        
        initComponents();


        
        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });

    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = JCPCOTIZACIONESApp.getApplication().getMainFrame();
            aboutBox = new JCPCOTIZACIONESAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        JCPCOTIZACIONESApp.getApplication().show(aboutBox);
    }

    
    @SuppressWarnings("unchecked")
    vistaProveedor vProveedor = new vistaProveedor();
    vistaCliente vCliente= new vistaCliente();
    vistaTipoDeMaquina vTipodeMaquina = new vistaTipoDeMaquina();
    vistaUsuario vUsuario= new vistaUsuario();
    vistaCotizacion vCotizacion = new vistaCotizacion();
    vistaOrdenPedido vop = new vistaOrdenPedido();
    Buscar vai = new Buscar();
    vistaOrdenProduccion vOProduccion = new vistaOrdenProduccion();




    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jDesktopPane1 = new javax.swing.JDesktopPane();
        frame_proveedor = new javax.swing.JInternalFrame();
        frame_clientes = new javax.swing.JInternalFrame();
        jToolBar1 = new javax.swing.JToolBar();
        bt_cliente = new javax.swing.JButton();
        bt_proveedor = new javax.swing.JButton();
        bt_usuario = new javax.swing.JButton();
        bt_maquina = new javax.swing.JButton();
        bt_orden = new javax.swing.JButton();
        bt_Oproduccion = new javax.swing.JButton();
        bt_cotizacion = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        frame_tipodemaquina = new javax.swing.JInternalFrame();
        frame_usuario = new javax.swing.JInternalFrame();
        frame_cotizacion = new javax.swing.JInternalFrame();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        frame_buscarCotizacion = new javax.swing.JInternalFrame();
        frame_ordenProduccion = new javax.swing.JInternalFrame();
        frame_ordenPedido = new javax.swing.JInternalFrame();
        menuBar = new javax.swing.JMenuBar();
        jMenu2 = new javax.swing.JMenu();
        Menu = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        menu_usuario = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        tx_usuario = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jDialog1 = new javax.swing.JDialog();

        frame_proveedor.setClosable(true);
        frame_proveedor.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_proveedor.setIconifiable(true);
        frame_proveedor.setTitle("Gestión de Proveedores");
        frame_proveedor.setMaximumSize(new java.awt.Dimension(850, 390));
        frame_proveedor.setMinimumSize(new java.awt.Dimension(850, 390));
        frame_proveedor.setPreferredSize(new java.awt.Dimension(850, 390));
        frame_proveedor.add(vProveedor.pisoProveedor);

        org.jdesktop.layout.GroupLayout frame_proveedorLayout = new org.jdesktop.layout.GroupLayout(frame_proveedor.getContentPane());
        frame_proveedor.getContentPane().setLayout(frame_proveedorLayout);
        frame_proveedorLayout.setHorizontalGroup(
            frame_proveedorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 880, Short.MAX_VALUE)
        );
        frame_proveedorLayout.setVerticalGroup(
            frame_proveedorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 385, Short.MAX_VALUE)
        );

        frame_proveedor.setBounds(90, 100, 890, 420);
        jDesktopPane1.add(frame_proveedor, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_clientes.setClosable(true);
        frame_clientes.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_clientes.setIconifiable(true);
        frame_clientes.setTitle("Getión Clientes");
        frame_clientes.add(vCliente.pisoCliente);
        frame_clientes.setMaximumSize(new java.awt.Dimension(860, 440));
        frame_clientes.setMinimumSize(new java.awt.Dimension(860, 440));
        frame_clientes.setPreferredSize(new java.awt.Dimension(860, 440));
        try {
            frame_clientes.setSelected(true);
        } catch (java.beans.PropertyVetoException e1) {
            e1.printStackTrace();
        }
        frame_clientes.setVerifyInputWhenFocusTarget(false);

        org.jdesktop.layout.GroupLayout frame_clientesLayout = new org.jdesktop.layout.GroupLayout(frame_clientes.getContentPane());
        frame_clientes.getContentPane().setLayout(frame_clientesLayout);
        frame_clientesLayout.setHorizontalGroup(
            frame_clientesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 850, Short.MAX_VALUE)
        );
        frame_clientesLayout.setVerticalGroup(
            frame_clientesLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 385, Short.MAX_VALUE)
        );

        frame_clientes.setBounds(100, 120, 860, 420);
        jDesktopPane1.add(frame_clientes, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jToolBar1.setBackground(new java.awt.Color(0, 0, 0));
        jToolBar1.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.lightGray, null));
        jToolBar1.setRollover(true);

        bt_cliente.setBackground(new java.awt.Color(0, 0, 0));
        bt_cliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/cliente.png"))); // NOI18N
        bt_cliente.setToolTipText("Clientes");
        bt_cliente.setFocusable(false);
        bt_cliente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_cliente.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/cli sobre.png"))); // NOI18N
        bt_cliente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_clienteActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_cliente);

        bt_proveedor.setBackground(new java.awt.Color(0, 0, 0));
        bt_proveedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/proveedor.png"))); // NOI18N
        bt_proveedor.setToolTipText("Proveedores");
        bt_proveedor.setFocusable(false);
        bt_proveedor.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_proveedor.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/pro sobre.png"))); // NOI18N
        bt_proveedor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_proveedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_proveedorActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_proveedor);

        bt_usuario.setBackground(new java.awt.Color(0, 0, 0));
        bt_usuario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/Live messenger.png"))); // NOI18N
        bt_usuario.setToolTipText("Usuarios");
        bt_usuario.setFocusable(false);
        bt_usuario.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_usuario.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/usu sobre.png"))); // NOI18N
        bt_usuario.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_usuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_usuarioActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_usuario);

        bt_maquina.setBackground(new java.awt.Color(0, 0, 0));
        bt_maquina.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/Drives_Downloads copia.png"))); // NOI18N
        bt_maquina.setToolTipText("Tipo de Máquina");
        bt_maquina.setFocusable(false);
        bt_maquina.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_maquina.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/tm sobre.png"))); // NOI18N
        bt_maquina.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_maquina.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_maquinaActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_maquina);

        bt_orden.setBackground(new java.awt.Color(0, 0, 0));
        bt_orden.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/Dossier 2 ouvert copia.png"))); // NOI18N
        bt_orden.setToolTipText("Orden de Pedido");
        bt_orden.setFocusable(false);
        bt_orden.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_orden.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/op sobre.png"))); // NOI18N
        bt_orden.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_orden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_ordenActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_orden);

        bt_Oproduccion.setBackground(new java.awt.Color(0, 0, 0));
        bt_Oproduccion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/opro.png"))); // NOI18N
        bt_Oproduccion.setToolTipText("Orden de Produccion");
        bt_Oproduccion.setFocusable(false);
        bt_Oproduccion.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_Oproduccion.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_Oproduccion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_OproduccionActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_Oproduccion);

        bt_cotizacion.setBackground(new java.awt.Color(0, 0, 0));
        bt_cotizacion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/window-spreadsheet-edit_256x256 copia.png"))); // NOI18N
        bt_cotizacion.setToolTipText("Cotización");
        bt_cotizacion.setFocusable(false);
        bt_cotizacion.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bt_cotizacion.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/coti sobre.png"))); // NOI18N
        bt_cotizacion.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bt_cotizacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_cotizacionActionPerformed(evt);
            }
        });
        jToolBar1.add(bt_cotizacion);

        jButton1.setBackground(new java.awt.Color(0, 0, 0));
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/buscar_cotizacion.png"))); // NOI18N
        jButton1.setToolTipText("Buscar Cotización");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        jButton2.setBackground(new java.awt.Color(0, 0, 0));
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/48x48/cerrar_Sesion.png"))); // NOI18N
        jButton2.setToolTipText("Cerrar Sesión");
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton2);

        jToolBar1.setBounds(0, 0, 2000, 60);
        jDesktopPane1.add(jToolBar1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_tipodemaquina.setClosable(true);
        frame_tipodemaquina.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_tipodemaquina.setIconifiable(true);
        frame_tipodemaquina.setTitle("Gestionar Tipo de Máquina");
        try {
            frame_tipodemaquina.setSelected(true);
        } catch (java.beans.PropertyVetoException e1) {
            e1.printStackTrace();
        }

        org.jdesktop.layout.GroupLayout frame_tipodemaquinaLayout = new org.jdesktop.layout.GroupLayout(frame_tipodemaquina.getContentPane());
        frame_tipodemaquina.getContentPane().setLayout(frame_tipodemaquinaLayout);
        frame_tipodemaquinaLayout.setHorizontalGroup(
            frame_tipodemaquinaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 850, Short.MAX_VALUE)
        );
        frame_tipodemaquinaLayout.setVerticalGroup(
            frame_tipodemaquinaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 415, Short.MAX_VALUE)
        );

        frame_tipodemaquina.add(vTipodeMaquina.pisoTipoDeMaquina);
        frame_tipodemaquina.getContentPane();

        frame_tipodemaquina.setBounds(30, 140, 860, 450);
        jDesktopPane1.add(frame_tipodemaquina, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_usuario.setClosable(true);
        frame_usuario.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_usuario.setIconifiable(true);
        frame_usuario.setTitle("Gestón Usuario");
        frame_usuario.add(vUsuario.pisoUsuario);

        org.jdesktop.layout.GroupLayout frame_usuarioLayout = new org.jdesktop.layout.GroupLayout(frame_usuario.getContentPane());
        frame_usuario.getContentPane().setLayout(frame_usuarioLayout);
        frame_usuarioLayout.setHorizontalGroup(
            frame_usuarioLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 840, Short.MAX_VALUE)
        );
        frame_usuarioLayout.setVerticalGroup(
            frame_usuarioLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 415, Short.MAX_VALUE)
        );

        frame_usuario.setBounds(20, 90, 850, 450);
        jDesktopPane1.add(frame_usuario, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_cotizacion.setClosable(true);
        frame_cotizacion.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_cotizacion.setIconifiable(true);
        frame_cotizacion.setTitle("Gestión de Cotización");
        frame_cotizacion.setMaximumSize(new java.awt.Dimension(757, 781));
        frame_cotizacion.setMinimumSize(new java.awt.Dimension(0, 0));
        frame_cotizacion.setPreferredSize(new java.awt.Dimension(757, 781));

        jScrollPane1.setMaximumSize(new java.awt.Dimension(651, 500));
        jScrollPane1.setMinimumSize(new java.awt.Dimension(651, 500));
        jScrollPane1.setPreferredSize(new java.awt.Dimension(651, 500));

        jPanel1.add(vCotizacion.pisoCotizacion);
        jPanel1.setMaximumSize(new java.awt.Dimension(651, 800));
        jPanel1.setPreferredSize(new java.awt.Dimension(651, 800));

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 661, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 800, Short.MAX_VALUE)
        );

        jScrollPane1.setViewportView(jPanel1);

        org.jdesktop.layout.GroupLayout frame_cotizacionLayout = new org.jdesktop.layout.GroupLayout(frame_cotizacion.getContentPane());
        frame_cotizacion.getContentPane().setLayout(frame_cotizacionLayout);
        frame_cotizacionLayout.setHorizontalGroup(
            frame_cotizacionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 680, Short.MAX_VALUE)
        );
        frame_cotizacionLayout.setVerticalGroup(
            frame_cotizacionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        //frame_cotizacion.add(vCotizacion.pisoCotizacion);

        frame_cotizacion.setBounds(150, 130, 690, 500);
        jDesktopPane1.add(frame_cotizacion, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_buscarCotizacion.setClosable(true);
        frame_buscarCotizacion.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_buscarCotizacion.setIconifiable(true);
        frame_buscarCotizacion.setTitle("Buscar Cotización");

        org.jdesktop.layout.GroupLayout frame_buscarCotizacionLayout = new org.jdesktop.layout.GroupLayout(frame_buscarCotizacion.getContentPane());
        frame_buscarCotizacion.getContentPane().setLayout(frame_buscarCotizacionLayout);
        frame_buscarCotizacionLayout.setHorizontalGroup(
            frame_buscarCotizacionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 800, Short.MAX_VALUE)
        );
        frame_buscarCotizacionLayout.setVerticalGroup(
            frame_buscarCotizacionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 415, Short.MAX_VALUE)
        );

        frame_buscarCotizacion.add(vai.piso_agregar);

        frame_buscarCotizacion.setBounds(40, 120, 810, 450);
        jDesktopPane1.add(frame_buscarCotizacion, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_ordenProduccion.setClosable(true);
        frame_ordenProduccion.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_ordenProduccion.setIconifiable(true);
        frame_ordenProduccion.setTitle("Orden de Producción");

        org.jdesktop.layout.GroupLayout frame_ordenProduccionLayout = new org.jdesktop.layout.GroupLayout(frame_ordenProduccion.getContentPane());
        frame_ordenProduccion.getContentPane().setLayout(frame_ordenProduccionLayout);
        frame_ordenProduccionLayout.setHorizontalGroup(
            frame_ordenProduccionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 620, Short.MAX_VALUE)
        );
        frame_ordenProduccionLayout.setVerticalGroup(
            frame_ordenProduccionLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 575, Short.MAX_VALUE)
        );

        frame_ordenProduccion.add(vOProduccion.pisoOrdenProduccion);

        frame_ordenProduccion.setBounds(80, 80, 630, 610);
        jDesktopPane1.add(frame_ordenProduccion, javax.swing.JLayeredPane.DEFAULT_LAYER);

        frame_ordenPedido.setClosable(true);
        frame_ordenPedido.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        frame_ordenPedido.setIconifiable(true);
        frame_ordenPedido.setTitle("Ordende Pedido");

        org.jdesktop.layout.GroupLayout frame_ordenPedidoLayout = new org.jdesktop.layout.GroupLayout(frame_ordenPedido.getContentPane());
        frame_ordenPedido.getContentPane().setLayout(frame_ordenPedidoLayout);
        frame_ordenPedidoLayout.setHorizontalGroup(
            frame_ordenPedidoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 620, Short.MAX_VALUE)
        );
        frame_ordenPedidoLayout.setVerticalGroup(
            frame_ordenPedidoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 583, Short.MAX_VALUE)
        );

        frame_ordenPedido.add(vop.pisoOrdenPedido);

        frame_ordenPedido.setBounds(120, 70, 630, 618);
        jDesktopPane1.add(frame_ordenPedido, javax.swing.JLayeredPane.DEFAULT_LAYER);

        org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jDesktopPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 727, Short.MAX_VALUE)
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jDesktopPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)
        );

        jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/AYUDA.png"))); // NOI18N
        menuBar.add(jMenu2);

        Menu.setText("Gestionar");
        Menu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuActionPerformed(evt);
            }
        });

        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/cliente.png"))); // NOI18N
        jMenuItem1.setText("Cliente");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem1);

        jMenuItem5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/proveedor.png"))); // NOI18N
        jMenuItem5.setText("Proveedor");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem5);

        menu_usuario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/Live messenger.png"))); // NOI18N
        menu_usuario.setText("Usuario");
        menu_usuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_usuarioActionPerformed(evt);
            }
        });
        Menu.add(menu_usuario);

        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/Drives_Downloads copia.png"))); // NOI18N
        jMenuItem2.setText("Tipo Máquina");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem2);
        Menu.add(jSeparator1);

        jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/Dossier 2 ouvert copia.png"))); // NOI18N
        jMenuItem6.setText("Orden de Pedido");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem6);

        jMenuItem9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/opro.png"))); // NOI18N
        jMenuItem9.setText("Orden de Producción");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem9);

        jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/window-spreadsheet-edit_256x256 copia.png"))); // NOI18N
        jMenuItem4.setText("Cotización");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem4);

        jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/buscar_cotizacion.png"))); // NOI18N
        jMenuItem3.setText("Buscar Cotización");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem3);
        Menu.add(jSeparator2);

        jMenuItem8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/Fermer.png"))); // NOI18N
        jMenuItem8.setText("Cerrar Sesión");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem8);

        jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        jMenuItem7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jcpcotizaciones/resources/iconos/16x16/Areter.png"))); // NOI18N
        jMenuItem7.setText("Salir");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        Menu.add(jMenuItem7);

        menuBar.add(Menu);

        jMenu3.setText("Reportes");
        menuBar.add(jMenu3);

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

        tx_usuario.setFont(new java.awt.Font("Tempus Sans ITC", 2, 18));
        tx_usuario.setForeground(new java.awt.Color(51, 51, 0));

        jLabel1.setText("Sesión de:");

        org.jdesktop.layout.GroupLayout statusPanelLayout = new org.jdesktop.layout.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(statusPanelSeparator, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 727, Short.MAX_VALUE)
            .add(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(statusMessageLabel)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(tx_usuario, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 317, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 174, Short.MAX_VALUE)
                .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(statusPanelLayout.createSequentialGroup()
                .add(statusPanelSeparator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 6, Short.MAX_VALUE)
                .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(statusMessageLabel)
                        .add(statusAnimationLabel)
                        .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(tx_usuario, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel1))
                .add(3, 3, 3))
        );

        jDialog1.setModal(true);

        org.jdesktop.layout.GroupLayout jDialog1Layout = new org.jdesktop.layout.GroupLayout(jDialog1.getContentPane());
        jDialog1.getContentPane().setLayout(jDialog1Layout);
        jDialog1Layout.setHorizontalGroup(
            jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 400, Short.MAX_VALUE)
        );
        jDialog1Layout.setVerticalGroup(
            jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 300, Short.MAX_VALUE)
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void bt_clienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_clienteActionPerformed
        frame_clientes.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_bt_clienteActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
       frame_clientes.setVisible(true);  // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void bt_proveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_proveedorActionPerformed
        frame_proveedor.setVisible(true);
    }//GEN-LAST:event_bt_proveedorActionPerformed

    private void bt_maquinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_maquinaActionPerformed
        frame_tipodemaquina.setVisible(true);
       vTipodeMaquina.listarProveedor();
    }//GEN-LAST:event_bt_maquinaActionPerformed

    private void bt_usuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_usuarioActionPerformed
        frame_usuario.setVisible(true);
    }//GEN-LAST:event_bt_usuarioActionPerformed

    private void bt_cotizacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_cotizacionActionPerformed
        frame_cotizacion.setVisible(true);
        vCotizacion.parametros();
    }//GEN-LAST:event_bt_cotizacionActionPerformed

    private void bt_ordenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_ordenActionPerformed
        vop.nueva();
        frame_ordenPedido.setVisible(true);

    }//GEN-LAST:event_bt_ordenActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        frame_tipodemaquina.setVisible(true);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        frame_proveedor.setVisible(true);
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void menu_usuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_usuarioActionPerformed
        frame_usuario.setVisible(true);
    }//GEN-LAST:event_menu_usuarioActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        frame_ordenPedido.setVisible(true);
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        frame_cotizacion.setVisible(true);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
      vai.bt_agregarPedido.setVisible(false);
      vai.bt_agregarproduccion.setVisible(false);
      vai.bt_salir.setVisible(false);
      vai.limpiar();
      frame_buscarCotizacion.setVisible(true);

    }//GEN-LAST:event_jButton1ActionPerformed

    private void MenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuActionPerformed
        vai.bt_agregarPedido.setVisible(false);
        vai.bt_agregarproduccion.setVisible(false);
        vai.bt_salir.setVisible(false);
        frame_buscarCotizacion.setVisible(true);
    }//GEN-LAST:event_MenuActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
      JOptionPane.showMessageDialog(null,"::: Cerrando Sesión :::");
        this.getFrame().setVisible(false);
        inicioSesion in = new inicioSesion();
        in.setLocationRelativeTo(null);
        in.setVisible(true);
        
       
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
       JOptionPane.showMessageDialog(null,"::: Cerrando Sesión :::");
        this.getFrame().setVisible(false);
        inicioSesion in = new inicioSesion();
        in.setLocationRelativeTo(null);
        in.setVisible(true);
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void bt_OproduccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_OproduccionActionPerformed
       vOProduccion.nueva();
        frame_ordenProduccion.setVisible(true);
        
    }//GEN-LAST:event_bt_OproduccionActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        frame_ordenProduccion.setVisible(true);
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
      vai.bt_agregarPedido.setVisible(false);
      vai.bt_agregarproduccion.setVisible(false);
      vai.bt_salir.setVisible(false);
      frame_buscarCotizacion.setVisible(true);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu Menu;
    private javax.swing.JButton bt_Oproduccion;
    public static javax.swing.JButton bt_cliente;
    public static javax.swing.JButton bt_cotizacion;
    public static javax.swing.JButton bt_maquina;
    public static javax.swing.JButton bt_orden;
    public static javax.swing.JButton bt_proveedor;
    public static javax.swing.JButton bt_usuario;
    private javax.swing.JInternalFrame frame_buscarCotizacion;
    public static javax.swing.JInternalFrame frame_clientes;
    public static javax.swing.JInternalFrame frame_cotizacion;
    public static javax.swing.JInternalFrame frame_ordenPedido;
    public static javax.swing.JInternalFrame frame_ordenProduccion;
    public static javax.swing.JInternalFrame frame_proveedor;
    public static javax.swing.JInternalFrame frame_tipodemaquina;
    public static javax.swing.JInternalFrame frame_usuario;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JDialog jDialog1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    public static javax.swing.JMenuItem menu_usuario;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    public static javax.swing.JLabel tx_usuario;
    // End of variables declaration//GEN-END:variables

    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

    private JDialog aboutBox;


    
}
